import React, { useState, useEffect } from 'react';
import { chat } from '@/api/login';
import { initTable } from '@/hoc';
import { Table } from 'antd';

function index(props: any) {

  const columns: any = [
    {
      title: 'ID',
      dataIndex: 'log_id',
      key: 'log_id',
      // render: (text) => <a>{text}</a>,
    },
    {
      title: '发送人',
      dataIndex: 'from_name',
      key: 'from_name',
    },
    {
      title: '消息',
      dataIndex: 'message',
      key: 'message',
    },
    {
      title: '接收人',
      dataIndex: 'to_name',
      key: 'to_name',
    },
    {
      title: '创建时间',
      key: 'create_time',
      dataIndex: 'create_time',
    },
  ];
  return (
    <Table
      columns={columns}
      dataSource={props.data}
      pagination={{
        // pageSize: 5,
        total: 50,
        showSizeChanger: true,
        // onShowSizeChange: onShowSizeChange,
        defaultCurrent: 1,
      }}
    />
  );
}

export default initTable(chat)(index);
